"""
这个工具文件, 专门来获取各种ID的
"""


import requests

from common.get_token import get_login_token


def get_department_id():
    """获取部门ID, 调用增加部门的接口, 获取id值"""
    resp = requests.post(url="http://ihrm-test.itheima.net/api/company/department",
                         headers={"Authorization": get_login_token()},
                         json={"name": "Test部门", "code": "66778899"})
    return resp.json().get("data").get("id")


if __name__ == '__main__':
    print(get_department_id())